<script>
    
$(document).ready(function() {
	 
    $('#timepicker').datepicker({
        dateFormat: "yy-mm-dd",
        timeFormat: "HH:mm:ss"

    });
    $('#timepicker1').datepicker({
        dateFormat: "yy-mm-dd",
        timeFormat: "HH:mm:ss"

    });
   
  
  });

</script>
<?php $data= $this->arrParams;?>

<?php echo $this->search_form;?>
<?php 
	
	if(!isset($data['ProductID'])) 
	    $data['ProductID']=0; 
	if(!isset($data['time_search']))
		$data['time_search']=5;
	
?>
<script type="text/javascript">

    $(document).ready(function(){
    //	alert(1);
       var start = $("#timepicker1").val();
       var end   = $("#timepicker").val();
       var time_search   = $("#time_search").val();
       var main_link = '/admin/user/chart-data/';
       link = main_link+'ProductID/'+<?php echo $data['ProductID'];?>;
       link = link+'/time_search/'+<?php echo $data['time_search'];?>;
       if(start!= null ){
     		link = link+'/Starttime/'+start;
       }
       if(end!=null){
          link = link+'/Endtime/'+end;
       }
    	       $.getJSON(link, function(data) {
       	   		// Create the chart
       	              Highcharts.setOptions({
       	             		global : {
       	             			useUTC : false
       	             		}
       	             	});
       	             	window.chart = new Highcharts.StockChart({
       	             		chart : {
       	             			renderTo : 'user',
       	             			events : {
       	             			}
       	             		},
       	             		rangeSelector: {
       	             			selected: 0
       	             		},
       	             		title : {
       	             			text : 'Biểu đồ tăng trưởng user'
       	             		},
       	             		yAxis: {
       	                 		min : 0
       	             		},
       	   				
       	             		exporting: {
       	             			enabled: false
       	             		},
       	             		
       	             		series : [{
       	             			name : 'Số người đăng ký',
       	             			data : data
       	             		}]
       	             	});
       	   	});
       	      
    });
</script>
<div id="user" style="height: 600px; width: 90%;float: right;padding-right: 2%;"></div>
<div style="clear: both;"></div>
